/*
 * Copyright (c) 2002-2003 by OpenSymphony
 * All rights reserved.
 */
/*
 * Created by IntelliJ IDEA.
 * User: plightbo
 * Date: Apr 29, 2002
 * Time: 11:12:05 PM
 */
package org.jackysoft.workflow;


import org.springframework.stereotype.Component;

/**
 * A basic workflow implementation which does not read in the current user from
 * any context, but allows one to be specified via the constructor. Also does
 * not support rollbacks.
 */
@Component
public class BasicWorkflow extends AbstractWorkflow {
	// ~ Constructors
	// ///////////////////////////////////////////////////////////
	public BasicWorkflow() {
		//TODO 获取当前用户
		String name = null;
		super.context = new BasicWorkflowContext(name);
	}

	public BasicWorkflow(String username) {
		super.context = new BasicWorkflowContext(username);
	}

	@Override
	public Workflow configContext() {
		//TODO 获取当前用户
		String name = null;
		if (super.context == null)
			super.context = new BasicWorkflowContext(name);
		else
			super.context.setCaller(name);
		log.info("工作流  caller 切换到:" + name);
		return this;
	}

}
